let obj = {
    name: '康少',
    age: 18,
    like: {
        a: '唱',
        b: '跳',
        c: 'rap',
    },
    a: undefined,
    b: null,
    e: {}
}
function deepClone(obj) {
    return new Promise((resolve) => {
        const { port1, port2 } = new MessageChannel()
        port1.postMessage(obj)
        port2.onMessage = (msg) => {
            resolve(msg.data)
        }
    })
}
async function cloneAndAssign() {
    let newObj = await deepClone(obj); // 等待 Promise 解析
    console.log('赋值后的newObj:', newObj); // 可以直接使用
    return newObj;
}
cloneAndAssign(); // 调用函数

